import Vue from 'vue'
import VueRouter from 'vue-router'
import User from '../views/User.vue'
import List from '../views/Homes/List.vue'
import Index from '@/views/index1.vue'
import Tabbar from '@/components/Tabbar.vue'
import UserEdit from '@/views/UserEdit.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'Index',
    component: Index
  },
  {
    path: '/tabbar',
    name: 'Tabbar',
    component: Tabbar,
    children: [
      {
        path: 'user',
        name: 'My',
        component: User
      },
      {
        path: 'list',
        name: 'List',
        component: List
      },
    ]
  },
  {
    path: '/user-edit',
    component: UserEdit
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
